package parameterized_type;

import java.util.ArrayList;
import java.util.List;

public class PtMethod {
    public <T> List<T> transferToList(T[] array) {
        List<T> list = new ArrayList<>();
        for (T t : array) {
            list.add(t);
        }
        return list;
    }

    public static void main(String[] args) {
        PtMethod ptMethod = new PtMethod();
        String[] array = new String[]{"AA","BB","DS","SA"};
        List<String> list = ptMethod.transferToList(array);
        System.out.println(list);
    }
}
